package com.chj.comp.common.core.feign;

import com.chj.comp.common.core.constant.ServiceNameConstant;
import com.chj.comp.common.core.entity.MqMessageInfo;
import com.chj.comp.common.core.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：cuihui
 * @date ：Created in 2022/6/14
 * @description：消息服务端远程接口
 * @modified By：
 */
@FeignClient(contextId = "remoteMqadminService", value = ServiceNameConstant.MQADMIN_SERVICE)
public interface RemoteMqadminService {
    /**
     * 保存消息
     * @param mqMessageInfo
     * @return
     */
    @PostMapping("/mqMessageInfo/addMqMessageInfo")
    Result addMqMessageInfo(@RequestBody MqMessageInfo mqMessageInfo);

    /**
     * 更新消息状态
     * @param  messageId  消息id
     * @param  status  消息状态
     * @return
     */
    @GetMapping("/mqMessageInfo/updateMqMessageStatus")
    Result updateMqMessageStatus(@RequestParam(value = "messageId") String messageId, @RequestParam(value = "status") String status);

    /**
     * 判断消息是否被消费
     * @param  messageId  消息id
     * @return R<Integer>
     */
    @GetMapping("/mqMessageInfo/judgeMqMessageStatus/{messageId}")
    Result<Integer> judgeMqMessageStatus(@PathVariable(value = "messageId") String messageId);

    /**
     * 消息发送次数+1
     * @param  messageId  消息id
     * @return
     */
    @GetMapping("/mqMessageInfo/addMqMessageSendNum/{messageId}")
    Result addMqMessageSendNum(@PathVariable(value = "messageId") String messageId);
}
